package edu.ynu.se.xiecheng.achitectureclass.dao;

import edu.ynu.se.xiecheng.achitectureclass.entity.Device;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface DeviceRepository extends JpaRepository<Device, Long> {
    boolean existsByDeviceTypeAndGreenhouseId(String deviceType, Long greenhouseId);
    Optional<Device> findBySerialNumber(String serialNumber);
    List<Device> findByGreenhouseId(Long greenhouseId);
    List<Device> findByDeviceType(String deviceType);
} 